home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 7
/
Eagles_Nest_Mac_Collection_Disc_7.TOAST
/
General Communication
/
USRv34ARA20
/
USR2_0.ARA
next >
Wrap
Text File
|
1994-09-20
|
9KB
|
477 lines
! USRobotics ARA 2.0 Modem Script
! 8/8/94 - 15:19
!
! This script should work with any of our modems using our current
! command-set. This would include all of our 9600, 14400, and 28800
! bps modems. There is a display problem in that the results do not
! appear correctly in the interactive display window. They will appear
! correctly in the logfile.
!
! 'mlts' resource info for this modem:
! byte 1 == 01 -> modem HAS builtin reliability protocols
! byte 2 == 00 -> reserved by Apple
! byte 3 == 21 -> max hex chars in varstr 7 (33 dec)
! byte 4 == 21 -> max hex chars in varstr 8
! byte 5 == 21 -> max hex chars in varstr 9
!
@ORIGINATE
@ANSWER
!
! set up the modem - label range is 1-10
!
! Mac talks to the modem at 57,600 bps.
serreset 57600, 0, 8, 1
!
! reset the serial port
HSReset 0 1 0 0 0 0
settries 0
!
@LABEL 1
matchclr
matchstr 1 3 "OK\13\10"
! &F - recall factory settings
! &D0 - Over-ride DTR for Hardware Handshaking Cables.
! &H1&R2 - Enable CTS/RTS Hardware flow control
! &B1 - Disable autobaud/lock DTE
! S0=0 - Don't answer calls
! E0V1Q0 - Turn command echo off/Enable Verbose responses
! &M0 - Enter normal mode (no reliability protocols)
write "AT&F&D0&H1&R2&B1&A0S0=0E0V1Q0&M0&A3\13"
matchread 15
inctries
iftries 2 71
!
! Reset the Modem
!
write "+++"
pause 5
write "ATH\13"
pause 5
DTRSet
flush
jump 1
!
@LABEL 3
! Modem responding & configured.
! determine if reliable link is requested.
!
! if modem mnp10 (v.42bis) link requested (var 4 == 2) then jump label 4
ifstr 4 4 "2"
!
! if modem v42 link requested (var 4 == 1) then jump label 5
ifstr 4 5 "1"
!
! if no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
ifstr 4 9 "0"
!
! else invalid value in var 4; exit w/error
jump 76
!
@LABEL 4
! THIS modem doesn't support mnp 10 links.
! It's used here to easily allow users to
! enable V.42bis.
Note "MNP10 not available. Enabling V.42bis" 3
!
@LABEL 5
! yes, v42 link is requested. OK for LAP-M -> MNP 4.
matchclr
matchstr 1 7 "OK\13\10"
! &A3 == gives PROTOCOL: and CONNECT result codes
! &M4 == v42 autoreliable mode
! &K3 == MNP 5 disabled, v42bis enabled
! &K0 == Data Compression disabled
write "AT&A3&M4&K0\13"
matchread 300
jump 71
!
@LABEL 7
! ARA is supposed to do a better job of compression than v.42bis,
! however, should you wish to try it, you may select MNP10
! in Remote Access Setup and this script will enable v.42bis.
! (USR modems do not support MNP10 compression)
ifstr 4 8 "2"
jump 9
@LABEL 8
matchclr
matchstr 1 9 "OK\13\10"
! &A3 (dec) adds COMPRESSION: result codes
! &K1 == MNP 5 and v42b enabled
! &K3 == v42b enabled, MNP-5 disabled
write "AT&A3&K3\13"
matchread 300
jump 71
!
@LABEL 9
! If speaker on flag is true, jump to label 13. Else turn off the speaker.
ifstr 2 13 "1"
pause 5
matchclr
matchstr 1 13 "OK\13\10"
write "ATM0\13"
matchread 30
jump 71
!
! modem ready, so enable answering or originate a call - label range is 11-30
!
@LABEL 13
pause 5
ifANSWER 62
!
! if normal dialing (parm 6 == 0) jump to 19
ifstr 6 19 "0"
!
! if blind dialing (parm 6 == 1) jump to 17
ifstr 6 17 "1"
!
! if manual dialing (parm 6 == 2) jump to 15
ifstr 6 15 "2"
!
! else invalid value in var 6; exit w/error
jump 76
!
@label 15
note "Manual dialing initiated" 3
! X1 to ignore dialtone & busy for manual dialing, D to dial
write "ATX1D \13"
jump 32
!
@label 17
note "Dialing without tone" 3
matchclr
matchstr 1 19 "OK\13\10"
! X1 to ignore dialtone & busy for blind dialing
write "ATX1\13"
matchread 30
jump 71
!
@label 19
! this is where we break up long dialstrings
!
! parm 1 is always the full dialstring from the conn doc
note "Dialing ^1" 3
! parm 3 is always "p" for pulse & "t" for tone
!
! if parm 8 == blank (complete dialstring in parm 7)
! then jump to label 27 & dial parm 7
ifstr 8 27 " "
!
! if parm 9 == blank (complete dialstring in parms 7 & 8)
! then jump to label 24 & dial parm 7 & 8
ifstr 9 24 " "
!
! else dial parm 7 & 8 & 9 (complete dialstring in parms 7, 8 & 9)
matchclr
matchstr 1 21 "OK\13\10"
! parm 7 holds first string fragment
write "ATD^3^7;\13"
matchread 400
! modem not responding; bailout.
jump 71
@label 21
! parm 8 holds second string fragment
matchclr
matchstr 1 22 "OK\13\10"
write "ATX3D^3^8;\13"
matchread 400
! modem not responding; bailout.
jump 71
@label 22
! parm 9 holds last string fragment
write "ATX3D^3^9\13"
jump 32
!
@label 24
matchclr
matchstr 1 25 "OK\13\10"
! parm 7 holds first string fragment
write "ATD^3^7;\13"
matchread 400
! modem not responding; bailout.
jump 71
@label 25
! parm 8 holds last string fragment
write "ATX3D^3^8\13"
jump 32
!
@label 27
! parm 7 holds entire string
write "ATD^3^7\13"
jump 32
!
! connecting - label range is 31-60
!
@LABEL 32
! The extra trapping for 1200 bps connections are due to a problem
! catching 12000 bps connections. I chose to check for 1200 twice
! instead of checking for 12000 before 1200.
!
matchclr
matchstr 1 34 "CONNECT 1200\13\10"
matchstr 2 35 "CONNECT 1200/ARQ"
matchstr 3 36 "CONNECT 2400"
matchstr 4 37 "CONNECT 4800"
matchstr 5 38 "CONNECT 7200"
matchstr 6 39 "CONNECT 9600"
matchstr 7 40 "CONNECT 12000"
matchstr 8 41 "CONNECT 14400"
matchstr 9 42 "CONNECT 16800"
matchstr 10 43 "CONNECT 19200"
matchstr 11 44 "CONNECT 21600"
matchstr 12 45 "CONNECT 24000"
matchstr 13 46 "CONNECT 26400"
matchstr 14 47 "CONNECT 28800"
matchstr 15 72 "NO DIAL TONE\13\10"
matchstr 16 73 "NO CARRIER\13\10"
matchstr 17 74 "BUSY\13\10"
matchstr 18 75 "NO ANSWER\13\10"
matchstr 19 73 "ERROR\13\10"
matchstr 20 68 "RING\13\10"
matchread 700
ifANSWER 32
jump 71
!
! THIS v32b modem has been setup to do cts handshaking,
! and we assume that a cts handshaking cable is being used,
! so we leave the serial port set to 57,600 bps.
!
@LABEL 34
note "Communicating at 1200 bps." 3
CommunicatingAt 1200
jump 48
!
@LABEL 35
note "Communicating at 1200 bps." 3
CommunicatingAt 1200
jump 49
!
@LABEL 36
note "Communicating at 2400 bps." 3
CommunicatingAt 2400
jump 48
!
@LABEL 37
note "Communicating at 4800 bps." 3
CommunicatingAt 4800
jump 48
!
@LABEL 38
note "Communicating at 7200 bps." 3
CommunicatingAt 7200
jump 48
!
@LABEL 39
note "Communicating at 9600 bps." 3
CommunicatingAt 9600
jump 48
!
@LABEL 40
note "Communicating at 12000 bps." 3
CommunicatingAt 12000
jump 48
!
@LABEL 41
note "Communicating at 14400 bps." 3
CommunicatingAt 14400
jump 48
!
@LABEL 42
note "Communicating at 16800 bps." 3
CommunicatingAt 16800
jump 48
!
@LABEL 43
note "Communicating at 19200 bps." 3
CommunicatingAt 19200
jump 48
!
@LABEL 44
note "Communicating at 21600 bps." 3
CommunicatingAt 21600
jump 48
!
@LABEL 45
note "Communicating at 24000 bps." 3
CommunicatingAt 24000
jump 48
!
@LABEL 46
note "Communicating at 26400 bps." 3
CommunicatingAt 26400
jump 48
!
@LABEL 47
note "Communicating at 28800 bps." 3
CommunicatingAt 28800
jump 48
!
! v42 link connections.
! userhook 2 tells ARA that a modem-to-modem error correcting protocol has been negotiated
! userhook 4 would tell ARA that a modem-to-modem mnp 10 protocol has been negotiated
!
@LABEL 48
pause 3
matchclr
matchstr 1 49 "/ARQ"
matchstr 2 57 "\13\10"
matchstr 3 57 "/NONE\13\10"
matchread 30
!
@LABEL 49
matchclr
matchstr 1 50 "/LAPM"
matchstr 2 51 "/MNP"
matchread 30
jump 58
!
@LABEL 50
note "Established Error-Correcting V.42 link." 3
USERHOOK 2
jump 52
!
@LABEL 51
note "Established Error-Correcting MNP link." 3
USERHOOK 2
jump 52
!
@LABEL 52
matchclr
! "MNP5" shouldn't be attainable with this current script, but
! I am including this result trap in case a user wishes to enable it.
!
matchstr 1 53 "/MNP5\13\10"
matchstr 2 54 "/V42BIS\13\10"
matchstr 3 56 "/NONE\13\10"
matchread 30
jump 58
!
@LABEL 53
note "Established Data-Compressing MNP5 link." 3
USERHOOK 4
jump 58
!
@LABEL 54
note "Established Data-Compressing V.42bis link." 3
USERHOOK 4
jump 58
!
@LABEL 56
note "No DC link. Using built-in ARA Compression routines." 3
jump 58
@LABEL 57
note "No EC or DC link. Using built-in ARA routines." 3
!
@LABEL 58
! Ensuring cts handshaking enabled.
note "Turning on CTS Handshaking" 3
HSReset 0 1 0 0 0 0
!
ifANSWER 59
pause 30
@LABEL 59
exit 0
!
! @ANSWER
! Set the modem to answer on 1st ring - label range is 61-70
!
@LABEL 62
matchclr
matchstr 1 32 "OK\13\10"
write "ATS0=1\13"
matchread 30
jump 71
!
@LABEL 68
ifORIGINATE 32
! claim the serial port
userhook 1
note "Answering phone..." 2
jump 32
!
! error messages - label range is 71-100
!
! Modem Not Responding
@LABEL 71
exit -6019
!
! No Dial Tone
@LABEL 72
exit -6020
!
! No Carrier or Error
@LABEL 73
exit -6021
!
! Busy
@LABEL 74
exit -6022
!
! No Answer
@LABEL 75
exit -6023
!
! varstring invalid value
@LABEL 76
exit -6027
!
! Hang up the modem - label range is 101-120
!
@HANGUP
@LABEL 102
settries 0
serreset 57600, 0, 8, 1
HSReset 0 0 0 0 0 0
@LABEL 105
!
! Try to get control of the modem.
!
DTRSet
pause 5
DTRClear
flush
!
@LABEL 108
flush
matchclr
matchstr 1 111 "NO CARRIER\13\10"
matchstr 2 111 "OK\13\10"
matchstr 3 111 "ERROR\13\10"
write "ATH\13"
matchread 30
inctries
iftries 3 71
DTRSet
pause 5
DTRClear
pause 5
DTRSet
flush
!
@LABEL 109
matchclr
matchstr 1 115 "OK\13\10"
write "+++"
matchread 15
jump 108
!
! recall the factory settings.
!
@LABEL 111
pause 15
matchclr
matchstr 1 114 "OK\13\10"
write "AT&F&D0E0V1Q0S0=0\13"
matchread 30
jump 71
!
@LABEL 114
exit 0
@LABEL 115
pause 50
jump 108
!
! labels 121-128 are reserved for future emergency hacks
!